<template>
  <view>
    <input :value="userInfo.phone"/>
    <input :value="userInfo.captcha"/>

  </view>
</template>

<script lang="ts">
// @ts-nocheck
import Vue from 'vue';
import {checkLogin} from "../../api/common/login";
export default Vue.extend({
  data() {
    return {
      userInfo: {
        phone: '',
        captcha: ''
      }
    };
  },
  onLoad(option) {
    checkLogin().then()
  },
  methods: {
    onSubmit() {
      console.log("手机号：", this.userInfo)
      if (this.userInfo.phone === '') {
        uni.showToast({
          icon: 'none',
          title: '请输入手机号'
        })
        return false;
      }
      if (this.userInfo.captcha === '') {
        uni.showToast({
          icon: 'none',
          title: '请输入验证码'
        })
        return false;
      }

      //todo 调用 绑定手机号api
      const code = 'A000'
      if (code === 'A000') {
        //弹窗登陆成功，跳转首页
      } else (code === 'Q005')
      {
        //弹窗账号密码错误。
      }


    }
  }
});
</script>
<style lang="scss">
.containar {
  .avatarUrl {
    padding: 80 rpx 0 40 rpx;
    background: #fff;

    button {
      background: #fff;
      line-height: 80 rpx;
      height: auto;
      width: auto;
      padding: 20 rpx 30 rpx;
      margin: 0;
      display: flex;
      justify-content: center;
      align-items: center;


      .refreshIcon {
        width: 160 rpx;
        height: 160 rpx;
        border-radius: 50%;
      }

      .jt {
        width: 14 rpx;
        height: 28 rpx;
      }
    }
  }

  // botton 去除边框
  button::after {
    border: none;
  }

  .nickname {
    background: #fff;
    padding: 20 rpx 30 rpx 80 rpx;
    display: flex;
    align-items: center;
    justify-content: center;

    .weui-input {
      padding-left: 60 rpx;
    }
  }

  .btn {
    width: 100%;

    .btn-sub {
      width: 670 rpx;
      margin: 80 rpx auto 0;
      height: 90 rpx;
      background: #DF8585;
      border-radius: 45 rpx;
      line-height: 90 rpx;
      text-align: center;
      font-size: 36 rpx;
      color: #fff;
    }
  }
}
</style>
